#.Pascal’s Triangle  使用条件语句和循环打印出 Pascal 三角形

from math import factorial


def pascal_triangle(n):
    for i in range(n):
        for j in range(n - i + 1):
            print(end=' ')

        for j in range(i + 1):
            print(factorial(i) // (factorial(j) * factorial(i - j)), end=' ')

        print()


if __name__ == '__main__':
    pascal_triangle(5)
